/* Copyright (c) 2004-2023 Peigen.info. All rights reserved. */
package info.peigen.hotpot.manage.core.util;

import cn.hutool.core.util.RuntimeUtil;
import lombok.extern.slf4j.Slf4j;
import org.noear.solon.Solon;
import org.noear.solon.SolonProps;

/**
 * <b>(ShellUtil)</b>
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2024/8/1
 */
@Slf4j
public class ShellUtil {
    public static void shell() {
        SolonProps props       = Solon.cfg();
        boolean    shellEnable = Boolean.parseBoolean(props.getProperty("hotpot.shell.enable"));
        String     shellPath   = props.getProperty("hotpot.shell.path");
        if (shellEnable) {
            String line = RuntimeUtil.execForStr(shellPath);
            log.info(line);
        }
    }
}
